import json

logindata={"username":"admin","password":"123456"}
# print(logindata,type(logindata))
# # 转字符串
# c=json.dumps(logindata)
# print(c,type(c))
# # 转字典
# a=json.loads(c)
# print(a,type(a))
# 转json文件
fann=r"F:\work\codings\python\2504\pythonjieko\data\32.json"
f=open(fann,"w")
w=json.dump(logindata,f)
# json转字典
f=open(fann,"r")
l=json.load(f)
print(l,type(l))